#!usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author: muchen
@file: DuobaoqibingPage.py
@time: 2024/12/26
"""

from selenium.webdriver.common.by import By
from autoTest_ecshop.base_page.base import BasePage


# 主页类继承基础类
class DuobaoqibingPage(BasePage):
    # 添加夺宝奇兵定位器
    duobaoqibing_add_loc = (By.LINK_TEXT, '添加夺宝奇兵')
    # 活动搜索框定位器
    search_act_loc = (By.NAME, 'keyword')
    # 搜索按钮定位器
    search_btn_loc = (By.CSS_SELECTOR, '[value=" 搜索 "]')


# 添加夺宝奇兵页面继承基础类
class AddDuobaoqibingPage(BasePage):
    # 添加夺宝奇兵页面表单定位器
    # 活动名称
    name_loc = (By.CSS_SELECTOR, '[name="snatch_name"]')
    # 商品关键字
    keyword_loc = (By.CSS_SELECTOR, '[name="keywords"]')
    # 搜索按钮
    search_loc = (By.CSS_SELECTOR, '[onclick="searchGoods()"]')
    # 活动商品下拉框
    goods_loc = (By.NAME, 'goods_id')
    # 活动商品规格下拉框
    product_loc = (By.NAME, 'product_id')
    # 开始时间
    start_time_loc = (By.NAME, 'start_time')
    # 结束时间
    end_time_loc = (By.NAME, 'end_time')
    # 价格下限
    price_start_loc = (By.NAME, 'start_price')
    # 价格上限
    price_end_loc = (By.NAME, 'end_price')
    # 最多需要支付的价格
    price_max_loc = (By.NAME, 'max_price')
    # 消耗积分
    cost_points_loc = (By.NAME, 'cost_points')
    # 活动描述
    desc_loc = (By.NAME, 'desc')
    # 提交表单按钮
    submit_loc = (By.CSS_SELECTOR, '[value=" 确定 "]')

    # 夺宝奇兵添加结果
    result_loc = (By.XPATH, '//tbody/tr/td[2]')

# 夺宝奇兵列表页面继承基础类
